﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;

namespace WXWeb
{
    public partial class WebForm3 : BasePage
    {
        DXLog d = new DXLog();
        DXLogBO dlog = new DXLogBO();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    d = dlog.GetModel(int.Parse(Request.QueryString["id"].ToString()));
                    if (d != null)
                    {
                        ToUser.Value = d.ToUser;
                        NR.Value = d.NR;
                        JG.Value = d.JG;
                    }
                }
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] != null)
            {
                d = dlog.GetModel(int.Parse(Request.QueryString["id"].ToString()));
                if (d != null)
                {
                    d.ToUser = ToUser.Value;
                    d.JG = JG.Value;
                    d.NR = NR.Value;
                    dlog.Update(d);
                    AlertRedirect("修改成功", "WebForm2.aspx");
                    //AlertMessage("修改成功");
                    Response.Redirect("WebForm2.aspx");
                }
            }
        }
    }
}